---@diagnostic disable: lowercase-global, undefined-global, trailing-space
local db = TUNING.MOD_ShadowFieldExciter
---@type data_containerUI
local params = {}

-- params.new_ui = {
--     widget =
--     {
--         animbank = 'ui_chest_3x3',
--         animbuild = 'ui_chest_3x3', 
--         slotpos = {},
--         slotbg = {},
--         pos = Vector3(-340, -120, 0),
--         side_align_tip = 160,
--         buttoninfo = {
--             text = 'hit',
--             position = Vector3(0, 80*-2+10, 0),
--         },
--         dragtype_drag = 'new_ui',
--         unique = 'new_ui',
--         opensound = '',
--         closesound = '',
--     },
--     type = 'new_ui',
--     itemtestfn = function(container, item, slot)
--         -- if slot == nil then -- 这样设置就能让shift左键失效,还能保证giveitem能用,我也不知道原因,群佬没告诉我
--         --     return false 
--         -- end
--         -- if item:HasTag('gem') then return true end
--         -- return false
--     end
-- }

-- for y = 2, 0, -1 do
--     for x = 0, 1 do
--         table.insert(params.new_ui.widget.slotpos, Vector3(80 * (x - 2) + 130, 80 * (y - 2) + 75, 0))
--         -- table.insert(params.new_ui.widget.slotbg, { atlas="images/slotbg/.xml",image = ".tex" })
--     end
-- end
params.shadowfieldexciter =  -- 宝箱容器参数表
{
    widget =  -- 定义UI小部件参数
    {
        animbuild = "sfe_interface",  -- 宝箱的动画构建名称
        animbank = "interface",  -- 宝箱的动画资源库名称
        slotpos = {},  -- 槽位位置数组，初始为空，后面会填充
        slotbg = {}, --槽位背景
        pos = Vector3(0, 0, 0),  -- UI在屏幕上的位置坐标
        side_align_tip = 0,  -- 侧边对齐提示位置
        -- buttons = {
        --     {
        --         text = STRINGS.MOD_ShadowFieldExciter.Btn_OpenList_Text,
        --         text_size = 38,
        --         position = Vector3(0, 135, 0),
        --         tooltip = STRINGS.MOD_ShadowFieldExciter.Btn_OpenList_ToolTip,
        --         fn = function(container, doer)
        --             -- 按钮1点击逻辑
        --         end
        --     },
        --     {
        --         text = STRINGS.MOD_ShadowFieldExciter.Btn_AddWhiteList_Text,
        --         text_size = 38,
        --         position = Vector3(-70, -135, 0),
        --         tooltip = STRINGS.MOD_ShadowFieldExciter.Btn_AddWhiteList_ToolTip,
        --         fn = function(container, doer)
        --             -- 按钮2点击逻辑
        --         end
        --     },
        --     {
        --         text = STRINGS.MOD_ShadowFieldExciter.Btn_AddBlackList_Text,
        --         text_size = 38,
        --         position = Vector3(70, -135, 0),
        --         tooltip = STRINGS.MOD_ShadowFieldExciter.Btn_AddBlackList_ToolTip,
        --         fn = function(container, doer)
        --             -- 按钮1点击逻辑
        --         end
        --     },
        -- },
        opensound = 'Shadow_Field_Exciter_soundfx/Shadow_Field_Exciter_container/open',
        closesound = 'Shadow_Field_Exciter_soundfx/Shadow_Field_Exciter_container/close',
        --dragtype_drag = "shadowfieldexciter"
        
    },
    type = db.Prefab_ID,  -- 容器类型为"mychest"
}

--设置容器槽位的自定义贴图
for i = 0, 11, 1 do
    table.insert(params.shadowfieldexciter.widget.slotbg,
    {image = "transparent_slotbg.tex",atlas = "images/my_futuristic_ui/my_futuristic_ui.xml"})
end

-- 设置容器槽位位置
-- for y = 0, 5, 1 do  -- 从顶行到底行
--     for x = 0, 1 do  -- 从左列到右列
--         -- 计算每个槽位的坐标位置
--         -- 80是槽位间距，-80*2是居中偏移
--         table.insert(params.shadowfieldexciter.widget.slotpos, Vector3(75 * x -520, -80 * y + 200, 0))
--     end
-- end
for y = 0, 5, 1 do
    table.insert(params.shadowfieldexciter.widget.slotpos, Vector3(-501, 188 + y*(-67.5), 0))
    table.insert(params.shadowfieldexciter.widget.slotpos, Vector3(-444, 154 + y*(-67.5), 0))
end



return params